import json
from os import listdir
with open('school_name_id.json', 'r', encoding='utf-8') as f:
    data = f.read()
    data = json.loads(data)
i = 0
k = 0
dic = {}
for s_k, s_v in data.items():
    if f'{s_k}.json' not in listdir('./save'):
        if i <= 500:
            dic[s_k] = s_v
            i += 1
        else:
            k += 1
            with open(f'./分组/{k}.json', 'w', encoding='utf-8') as f:
                json.dump(dic, f, indent=4, ensure_ascii=False)
            dic = {}
            i = 0
k += 1
with open(f'./分组/{k}.json', 'w', encoding='utf-8') as f:
    json.dump(dic, f, indent=4, ensure_ascii=False)


        



